/**
 * @param {string} s
 * @param {string} t
 * @return {number}
 */
var countSubstrings = function (s, t) {
  let count = 0,
    right,
    sub
  for (let i = 0; i < s.length; i++) {
    right = i + 1
    while (right < s.length + 1) {
      sub = s.substring(i, right)
      for (let j = 0; j < t.length; j += sub.length) {
        let tsub = t.substring(j, j+sub.length)
        
      }
      right++
    }
  }
}

countSubstrings('abab', 'baba')
